package com.papers.system.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.papers.common.core.domain.entity.SysDept;
import com.papers.common.core.domain.entity.SysUser;
import com.papers.common.core.mapper.BaseMapperPlus;
import com.papers.juan.domain.bean.CourseKnowledgeCodeBean;
import com.papers.system.domain.TJuanCourse;
import com.papers.system.domain.bo.TJuanCourseBo;
import com.papers.system.domain.dto.TJuanCourseDto;
import com.papers.system.domain.dto.TJuanUserCourseDto;
import com.papers.system.domain.vo.TJuanCourseListVo;
import com.papers.system.domain.vo.TJuanCourseVo;
import com.papers.system.domain.vo.TJuanLeftTreeListVo;
import com.papers.system.domain.vo.TJuanLeftTreeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 课程Mapper接口
 *
 * @author papers
 * @date 2022-10-12
 */
public interface TJuanCourseMapper extends BaseMapperPlus<TJuanCourseMapper, TJuanCourse, TJuanCourseVo> {

    //查询课程
    Page<TJuanCourseVo> getCourseByPage(@Param("page") Page<TJuanCourseVo> page, @Param("dto") TJuanCourseDto dto,
                                        @Param("deptList")List<SysDept> deptList, @Param("clickDept")List<SysDept> clickDept);

    //根据课程id查询课程
    TJuanCourseVo getVoById(@Param("id") String courseId);

    List<TJuanCourse> getCourseByUserId(@Param("userId") Long userId);

    /**
     * 查询课程树
     *
     * @param majorId
     * @return
     */
    List<TJuanLeftTreeVo> getCourseTreeList(@Param("id") String majorId);

    /**
     * 查询课程(包括院系编码和专业编码)
     *
     * @return
     */
    List<TJuanCourseListVo> getCourseList(@Param("bo") TJuanCourseBo bo);

    /**
     * 获取课程知识点编码列表
     *
     * @return 课程知识点编码code
     */
    List<CourseKnowledgeCodeBean> queryCourseKnowledgeCodeList();

    List<TJuanLeftTreeVo> getCourseTreeListVo(@Param("id")String majorId);

    List<TJuanLeftTreeListVo> getCourseMajorTreeVo(@Param("id")String majorId);

    Page<SysUser> selectAllocatedList(@Param("page") Page<SysUser> build, @Param("dto") TJuanUserCourseDto dto);

    Page<SysUser> selectUnallocatedList(@Param("page")Page<SysUser> build, @Param("dto")TJuanUserCourseDto dto);

    void deleteBindUsers(@Param("courseId")String courseId, @Param("id") String userIds);

    List<SysUser> selectAllUserList(@Param("dto")String courseId);

    List<String> selectCodeList(@Param("id") String department);

    List<SysDept> getTreeAndCourse(@Param("dataList")List<SysDept> dataList);

    List<TJuanLeftTreeVo> getLeftTree(@Param("id") String department, @Param("userName") String userName);

    List<TJuanCourseVo> getStatisticsByTotal(@Param("dto") TJuanCourseDto dto);
}
